unit FormTest;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, ExtCtrls, StdCtrls, PopupTrackbar, Menus, Grids;

type
  TForm1 = class(TForm)
    Panel1: TPanel;
    Panel2: TPanel;
    Panel3: TPanel;
    PopupTrackBar: TPopupTrackBar;
    StringGrid1: TStringGrid;
    procedure PanelMouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure PopupTrackBarSetValue(Sender: TObject; var Value: Double;
      Data: TObject);
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

uses CommCtrl;

{$R *.dfm}

procedure TForm1.PanelMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  PopupTrackbar.Popup(Sender, StrToFloatDef(TPanel(Sender).Caption, 0.0));
end;

procedure TForm1.PopupTrackBarSetValue(Sender: TObject; var Value: Double;
  Data: TObject);
begin
  if Data is TPanel then
    (Data as TPanel).Caption := FloatToStr(Value);
end;

end.
